import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "lib-flexible";
import "./index.less";
import { ConfigProvider } from "antd-mobile";
import zhCN from "antd-mobile/es/locales/zh-CN";
import { BrowserRouter } from "react-router-dom";

//处理最大宽度
(function () {
  const handleMax = function handleMax() {
    let html = document.documentElement;
    let root = document.getElementById("root");
    let deviceW = html.clientWidth;
    root.style.maxWidth = "750px";
    if (deviceW >= 750) {
      html.style.fontSize = "75px";
    }
  };
  handleMax();
  window.addEventListener("resize", handleMax);
})();

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <React.StrictMode>
    <BrowserRouter>
      <ConfigProvider locale={zhCN}>
        <App />
      </ConfigProvider>
    </BrowserRouter>
  </React.StrictMode>
);
